home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / ddjgrep.zip / TOOLS.H < prev   
C/C++ Source or Header  |  1987-11-04  |  4KB  |  114 lines

  1. /*---------------------------------------------------------------------------
  2.  *        TOOLS.H  various defines and typedefs for grep 
  3.  *
  4.  *                Copyright (c) 1984 Allen Holub
  5.  *      Copyright (c) 1984 Software Engineering Consultants
  6.  *                      P.O. Box 5679
  7.  *                   Berkeley, CA.  94705
  8.  *
  9.  *                     All rights reserved.
  10.  *
  11.  *      This program may be copied for personal, non-commmercial use
  12.  *      only, provided that this copyright notice is included in all
  13.  *      copies and that this program is not modified in any way.
  14.  *      Copying for any other use without previously obtaining the 
  15.  *      written permission of the author is prohibited.
  16.  *
  17.  *---------------------------------------------------------------------------
  18.  */
  19.  
  20.  
  21. #define NUL     0x00       /*   ^@   */
  22. #define SOH     0x01       /*   ^A   */
  23. #define STX     0x02       /*   ^B   */
  24. #define ETX     0x03       /*   ^C   */
  25. #define EOT     0x04       /*   ^D   */
  26. #define ENQ     0x05       /*   ^E   */
  27. #define ACK     0x06       /*   ^F   */
  28. #define BEL     0x07       /*   ^G   */
  29. #define BS      0x08       /*   ^H   */
  30. #define HT      0x09       /*   ^I   */
  31. #define LF      0x0a       /*   ^J   */
  32. #define NL      LF
  33. #define VT      0x0b       /*   ^K   */
  34. #define FF      0x0c       /*   ^L   */
  35. #define CR      0x0d       /*   ^M   */
  36. #define SO      0x0e       /*   ^N   */
  37. #define SI      0x0f       /*   ^O   */
  38. #define DLE     0x10       /*   ^P   */
  39. #define DC1     0x11       /*   ^Q   */
  40. #define DC2     0x12       /*   ^R   */
  41. #define DC3     0x13       /*   ^S   */
  42. #define DC4     0x14       /*   ^T   */
  43. #define NAK     0x15       /*   ^U   */
  44. #define SYN     0x16       /*   ^V   */
  45. #define ETB     0x17       /*   ^W   */
  46. #define CAN     0x18       /*   ^X   */
  47. #define EM      0x19       /*   ^Y   */
  48. #define SUB     0x1a       /*   ^Z   */
  49. #define ESC     0x1b       /*   ^[   */
  50. #define FS      0x1c       /*   ^\   */
  51. #define GS      0x1d       /*   ^]   */
  52. #define RS      0x1e       /*   ^^   */
  53. #define US      0x1f       /*   ^_   */
  54. #define DEL     0x7f       /*   DEL  */
  55.  
  56.  
  57. #define TRUE    1
  58. #define FALSE   0
  59.  
  60. /*      Definitions of meta-characters used in pattern matching routines
  61.  *      LITCHAR & NCCL are only used as token identifiers; all the others
  62.  *      are also both token identifiers and the actual symbol used in the
  63.  *      regular expression
  64.  */
  65.  
  66. #define BOL     '^'
  67. #define EOL     '$'
  68. #define ANY     '.'
  69. #define LITCHAR 'L'
  70. #define ESCAPE  '\\'
  71. #define CCL     '['             /* Character class:  [...]              */
  72. #define CCLEND  ']'
  73. #define NEGATE  '^'
  74. #define NCCL    '!'             /* Negative character class [^...]      */
  75. #define CLOSURE '*'
  76. #define OR_SYM  '|'
  77. #define CLS_SIZE   128          /* Largest permitted size for an expanded 
  78.                                 ** character class.  (Ie. the class [a-z]
  79.                                 ** will expand into 26 symbols; [a-z0-9] will
  80.                                 ** expand into 36 symbols.
  81.                                 */
  82.  
  83. /*      Tokens used to hold pattern templates.                          */
  84.  
  85. typedef struct token
  86. {
  87.         char            tok;
  88.         char            lchar;
  89.         char            *bitmap;
  90.         struct  token   *next;
  91. }TOKEN;
  92.  
  93. #define TOKSIZE sizeof(TOKEN)
  94.  
  95. #define MAXSTR  132             /* maximun number of characters in a line  */
  96.  
  97.  
  98. extern  char    *matchs();
  99. extern  int     amatch();
  100. extern  char    *in_string();
  101. extern  TOKEN   *getpat();
  102. extern  int     esc();
  103. extern  int     dodash();
  104. extern  TOKEN   *makepat();
  105. extern  int     unmakepat();
  106. extern  int     insert();
  107. extern  int     delete();
  108. extern  int     isalphanum();
  109. extern  int     stoupper();
  110. extern  int     pr_tok();
  111. extern  int     pr_line();
  112. extern  int     max();
  113.  
  114.